import 'package:enterprise_v6_app/app/components/custom_modele/custom_card.dart';
import 'package:enterprise_v6_app/app/components/custom_modele/custom_color_type_indicator.dart';
import 'package:enterprise_v6_app/app/components/custom_modele/custom_count_panel.dart';
import 'package:enterprise_v6_app/app/components/custom_modele/custom_gradient_progress.dart';
import 'package:enterprise_v6_app/app/core/core.dart';
import 'package:enterprise_v6_app/app/core/ext/widget_extension.dart';
import 'package:enterprise_v6_app/app/core/utils/file_util.dart';
import 'package:enterprise_v6_app/app/core/utils/interface.dart';
import 'package:enterprise_v6_app/app/data/common/charts_pie.dart';
import 'package:enterprise_v6_app/app/modules/application/standardization/detail/model.dart';
import 'package:enterprise_v6_app/app/modules/application/standardization/home/home_ctrl.dart';
import 'package:enterprise_v6_app/router/app_pages.dart';
import 'package:syncfusion_flutter_charts/charts.dart';

/// 标准化总览
class StandardizationHomeView extends StatelessWidget {
  StandardizationHomeView({super.key});

  final ctrl = Get.put(StandardizationHomeController());

  final _titleStyle = TextStyle(
    fontSize: 15.w,
    fontWeight: FontWeight.w500,
  );

  @override
  Widget build(BuildContext context) {
    return GetBuilder(
      init: ctrl,
      builder: (_) {
        return _buildBody();
      },
    );
  }

  Widget _buildBody() {
    return ListView(
      padding: EdgeInsets.all(11.w),
      children: [
        _buildSelfLevel(),
        AppGaps.vGap14,
        _buildScenceMgmt(),
        AppGaps.vGap14,
        _buildGoalAndResponsibility(),
        AppGaps.vGap14,
        _buildRegulation(),
        AppGaps.vGap14,
        _buildEdu(),
        AppGaps.vGap14,
        _buildRiskMgmt(),
        AppGaps.vGap14,
        _buildUrgentMgmt(),
      ],
    );
  }

  Widget _buildSelfLevel() {
    return CustomCard(
      titleWidget: Row(
        mainAxisAlignment: MainAxisAlignment.spaceBetween,
        children: [
          Row(
            children: [
              SvgPicture.asset(AppImages.icon_title),
              AppGaps.hGap4,
              Text(
                '自评等级 / ',
                style: _titleStyle,
              ),
              Text(
                ctrl.evaluate?.selfEvaluationLevel ?? '未知',
                style: _titleStyle.copyWith(color: Colors.blue),
              ),
            ],
          ),
          Row(
            children: [
              Stack(
                alignment: Alignment.center,
                children: [
                  SvgPicture.asset(
                    ctrl.isSelfEvaluate ? AppImages.icon_left_blue_trapezium : AppImages.icon_left_grey_trapezium,
                    height: 25.w,
                  ),
                  Text(
                    '自评',
                    style: TextStyle(color: ctrl.isSelfEvaluate ? Colors.white : const Color(0xFF9FA5B0)),
                  ).paddingOnly(right: 3.w),
                ],
              ).clickOnce(() {
                ctrl.isSelfEvaluate = true;
                ctrl.update();
              }),
              Stack(
                alignment: Alignment.center,
                children: [
                  SvgPicture.asset(
                    ctrl.isSelfEvaluate ? AppImages.icon_right_grey_trapezium : AppImages.icon_right_blue_trapezium,
                    height: 25.w,
                  ),
                  Text(
                    '他评',
                    style: TextStyle(color: ctrl.isSelfEvaluate ? const Color(0xFF9FA5B0) : Colors.white),
                  ).paddingOnly(left: 3.w),
                ],
              ).clickOnce(() {
                ctrl.isSelfEvaluate = false;
                ctrl.update();
              }),
            ],
          )
        ],
      ),
      divider: CustomCard.builtinDividerWithPadding,
      content: Column(
        children: ctrl.isSelfEvaluate
            ? [
                _buildInfoItem('到期日期', ctrl.evaluate?.overDateSelf ?? '未知'),
                _buildInfoItem('自评报告', ctrl.evaluate?.filePathSelf ?? '未知'),
              ]
            : [
                _buildInfoItem('到期日期', ctrl.evaluate?.overDate ?? '未知'),
                _buildInfoItem('自评报告', ctrl.evaluate?.filePath ?? '未知'),
              ],
      ),
    );
  }

  Widget _buildScenceMgmt() {
    return CustomCard(
      titleWidget: Row(
        children: [
          SvgPicture.asset(AppImages.icon_title),
          AppGaps.hGap6,
          Text(
            '现场管理',
            style: _titleStyle,
          ),
        ],
      ),
      divider: CustomCard.builtinDividerWithPadding,
      content: Column(
        children: [
          Row(
            mainAxisAlignment: MainAxisAlignment.spaceBetween,
            children: [
              _buildScenceMgmtItem(
                '设备设施管理',
                AppImages.icon_round_server_blue,
                () {
                  Get.toNamed(
                    AppRoutes.standardHomeDetail,
                    arguments: {
                      'type': StandardizationDetailType.equip,
                      'data': {
                        '设备设施建设': ctrl.scenceFacility?.create,
                        '设备设施验收': ctrl.scenceFacility?.accept,
                        '设备设施运行': ctrl.scenceFacility?.run,
                        '设备设施维修': ctrl.scenceFacility?.inspection,
                        '检验与废拆': ctrl.scenceFacility?.check,
                      },
                    },
                  );
                },
              ),
              _buildScenceMgmtItem(
                '职业健康',
                AppImages.icon_round_monitor_blue,
                () {
                  Get.toNamed(
                    AppRoutes.standardHomeDetail,
                    arguments: {
                      'type': StandardizationDetailType.health,
                      'data': {
                        '职业健康三同时': ctrl.scenceHealth?.th,
                        '职业卫生档案': ctrl.scenceHealth?.oha,
                        '职业健康检测': ctrl.scenceHealth?.oht,
                        '职业病危害申报': ctrl.scenceHealth?.ocd,
                        '职业危害告知': ctrl.scenceHealth?.onf,
                      },
                    },
                  );
                },
              ),
            ],
          ),
          AppGaps.vGap10,
          Row(
            mainAxisAlignment: MainAxisAlignment.spaceBetween,
            children: [
              _buildScenceMgmtItem(
                '作业安全',
                AppImages.icon_round_security_blue,
                () {
                  Get.toNamed(
                    AppRoutes.standardHomeDetail,
                    arguments: {
                      'type': StandardizationDetailType.safety,
                      'data': {
                        '作业管理协议': ctrl.scenceWork?.mp,
                        '作业行为检查': ctrl.scenceWork?.lpa,
                        '第三方管理制度': ctrl.scenceWork?.tssm,
                        '第三方管理协议': ctrl.scenceWork?.tssa,
                        '第三方资质审查': ctrl.scenceWork?.qrr,
                      },
                    },
                  );
                },
              ),
              _buildScenceMgmtItem(
                '警示标识',
                AppImages.icon_round_alarm_blue,
                () {
                  Get.toNamed(
                    AppRoutes.standardHomeDetail,
                    arguments: {
                      'type': StandardizationDetailType.alarm,
                      'data': {
                        '警示标志管理制度': ctrl.scenceSign?.wsm,
                        '警示标志': ctrl.scenceSign?.ws,
                      },
                    },
                  );
                },
              ),
            ],
          )
        ],
      ),
    );
  }

  Widget _buildGoalAndResponsibility() {
    final annoCenter = Container(
      width: 56.w,
      height: 56.w,
      decoration: BoxDecoration(
        color: Colors.white,
        borderRadius: BorderRadius.circular(50.w),
      ),
      child: Column(
        mainAxisAlignment: MainAxisAlignment.center,
        children: [
          Text(
            '持证情况',
            style: TextStyle(
              fontSize: 11.w,
              fontWeight: FontWeight.w400,
              color: const Color(0xffA0A7B5),
            ),
          ),
          Text(
            '${ctrl.certDeviceCount}',
            style: TextStyle(fontSize: 15.w, fontWeight: FontWeight.w400, color: const Color(0xFF495061)),
          ),
        ],
      ),
    );
    return CustomCard(
      title: '目标职责',
      divider: CustomCard.builtinDividerWithPadding,
      content: Column(
        children: [
          _buildChartTitle('安全生产责任落实情况'),
          AppGaps.vGap6,
          CustomGradientProgress(
            title: '部门落实率',
            vals: (
              actual: ctrl.targetResp?.departmentCountPracticable ?? 0,
              total: ctrl.targetResp?.departmentCount ?? 1,
            ),
          ),
          AppGaps.vGap6,
          CustomGradientProgress(
            title: '岗位落实率',
            vals: (
              actual: ctrl.targetResp?.positionCountPracticable ?? 0,
              total: ctrl.targetResp?.positionCount ?? 1,
            ),
          ),
          _buildChartTitle('持证情况'),
          AppGaps.vGap6,
          CustomGradientProgress(
            title: '企业证照',
            vals: (
              actual: ctrl.targetCert?.enterpriseSum ?? 0,
              total: ctrl.targetCertLargest,
            ),
            indicators: CustomGradientProgress.onlyRightCount,
            showDotOnProgress: false,
          ),
          AppGaps.vGap6,
          CustomGradientProgress(
            title: '设备证照',
            vals: (
              actual: ctrl.targetCert?.deviceSum ?? 0,
              total: ctrl.targetCertLargest,
            ),
            indicators: CustomGradientProgress.onlyRightCount,
            showDotOnProgress: false,
          ),
          AppGaps.vGap6,
          CustomGradientProgress(
            title: '人员证照',
            vals: (
              actual: ctrl.targetCert?.personnelSum ?? 0,
              total: ctrl.targetCertLargest,
            ),
            indicators: CustomGradientProgress.onlyRightCount,
            showDotOnProgress: false,
          ),
          AppGaps.vGap20,
          Row(
            children: [
              SizedBox(
                height: 91.w,
                width: 91.w,
                child: SfCircularChart(
                  series: <CircularSeries>[
                    DoughnutSeries<ChartData, String>(
                      dataSource: ctrl.certDeviceCounts,
                      pointColorMapper: (ChartData data, _) => data.color,
                      xValueMapper: (ChartData data, _) => data.x,
                      yValueMapper: (ChartData data, _) => data.y,
                      name: '持证情况',
                      dataLabelSettings: const DataLabelSettings(
                        isVisible: false,
                        labelPosition: ChartDataLabelPosition.inside,
                      ),
                      radius: '100%',
                      innerRadius: '65%',
                      enableTooltip: true,
                    ),
                  ],
                  annotations: [
                    CircularChartAnnotation(
                      widget: ctrl.certDeviceCount == 0
                          ? Stack(
                              alignment: Alignment.center,
                              children: [
                                annoCenter,
                                SizedBox(
                                  width: 73.w,
                                  height: 73.w,
                                  child: CircularProgressIndicator(
                                    strokeWidth: 7.w,
                                    value: 1,
                                    valueColor: const AlwaysStoppedAnimation<Color>(Color(0xFFFC9900)),
                                  ),
                                ),
                              ],
                            )
                          : annoCenter,
                    ),
                  ],
                ),
              ),
              const Spacer(),
              CustomColorTypeIndicator(
                colors: ctrl.certDeviceCounts.map((e) => e.color ?? Colors.white).toList(),
                types: ctrl.certDeviceCounts.map((e) => e.x).toList(),
                vals: ctrl.certDeviceCounts.map((e) => e.y.toInt().toString()).toList(),
                matrix: (1, ctrl.certDeviceCounts.length),
                padding: EdgeInsets.symmetric(horizontal: 5.w, vertical: 1.7.w),
              ),
            ],
          )
        ],
      ),
    );
  }

  Widget _buildRegulation() {
    return CustomCard(
      title: '制度化管理完善情况',
      divider: CustomCard.builtinDividerWithPadding,
      content: Column(
        children: [
          CustomGradientProgress(
            title: '法规标准',
            vals: (
              actual: ctrl.regulation?.law ?? 0,
              total: ctrl.regulationLargest,
            ),
            indicators: CustomGradientProgress.onlyRightCount,
            showDotOnProgress: false,
          ),
          AppGaps.vGap6,
          CustomGradientProgress(
            title: '规章规程',
            vals: (
              actual: ctrl.regulation?.rulesAndRegulations ?? 0,
              total: ctrl.regulationLargest,
            ),
            indicators: CustomGradientProgress.onlyRightCount,
            showDotOnProgress: false,
          ),
        ],
      ),
    );
  }

  Widget _buildEdu() {
    return CustomCard(
      title: '教育培训情况',
      divider: CustomCard.builtinDividerWithPadding,
      content: Column(
        children: [
          CustomCountPanel(
            counts: {
              '需求调研': '${ctrl.edu?.surveyCount ?? 0}个',
              '培训计划': '${ctrl.edu?.planCount ?? 0}个',
              '培训教材': '${ctrl.edu?.textBookCount ?? 0}个',
              '培训覆盖': '${ctrl.edu?.rate ?? 0}%',
            },
          ),
        ],
      ),
    );
  }

  Widget _buildRiskMgmt() {
    final initAnnoCenter = Container(
      width: 56.w,
      height: 56.w,
      decoration: BoxDecoration(
        color: Colors.white,
        borderRadius: BorderRadius.circular(50.w),
      ),
      child: Column(
        mainAxisAlignment: MainAxisAlignment.center,
        children: [
          Text(
            '初始风险',
            style: TextStyle(
              fontSize: 12.w,
              fontWeight: FontWeight.w400,
              color: const Color(0xffA0A7B5),
            ),
          ),
          Text(
            '${ctrl.initRiskCount}',
            style: TextStyle(fontSize: 16.w, fontWeight: FontWeight.w400, color: const Color(0xFF495061)),
          ),
        ],
      ),
    );
    final leftAnnoCenter = Container(
      width: 56.w,
      height: 56.w,
      decoration: BoxDecoration(
        color: Colors.white,
        borderRadius: BorderRadius.circular(50.w),
      ),
      child: Column(
        mainAxisAlignment: MainAxisAlignment.center,
        children: [
          Text(
            '剩余风险',
            style: TextStyle(
              fontSize: 12.w,
              fontWeight: FontWeight.w400,
              color: const Color(0xffA0A7B5),
            ),
          ),
          Text(
            '${ctrl.leftRiskCount}',
            style: TextStyle(fontSize: 16.w, fontWeight: FontWeight.w400, color: const Color(0xFF495061)),
          ),
        ],
      ),
    );
    return CustomCard(
      title: '风险管控及隐患治理',
      divider: CustomCard.builtinDividerWithPadding,
      content: Column(children: [
        _buildChartTitle('风险分析'),
        SizedBox(
          height: 107.w,
          width: 107.w,
          child: SfCircularChart(
            series: <CircularSeries>[
              DoughnutSeries<ChartData, String>(
                dataSource: ctrl.initRiskCounts,
                pointColorMapper: (ChartData data, _) => data.color,
                xValueMapper: (ChartData data, _) => data.x,
                yValueMapper: (ChartData data, _) => data.y,
                name: '初始风险',
                dataLabelSettings: const DataLabelSettings(
                  isVisible: false,
                  labelPosition: ChartDataLabelPosition.inside,
                ),
                radius: '100%',
                innerRadius: '75%',
                enableTooltip: true,
              ),
            ],
            annotations: [
              CircularChartAnnotation(
                widget: ctrl.initRiskCount == 0
                    ? Stack(
                        alignment: Alignment.center,
                        children: [
                          initAnnoCenter,
                          SizedBox(
                            width: 73.w,
                            height: 73.w,
                            child: CircularProgressIndicator(
                              strokeWidth: 7.w,
                              value: 1,
                              valueColor: const AlwaysStoppedAnimation<Color>(Color(0xFFFC9900)),
                            ),
                          ),
                        ],
                      )
                    : initAnnoCenter,
              ),
            ],
          ),
        ),
        CustomColorTypeIndicator(
          colors: ctrl.initRiskCounts.map((e) => e.color ?? Colors.white).toList(),
          types: ctrl.initRiskCounts.map((e) => e.x).toList(),
          vals: ctrl.initRiskCounts.map((e) => e.y.toInt().toString()).toList(),
          matrix: (2, 2),
          padding: EdgeInsets.symmetric(horizontal: 11.w, vertical: 7.w),
        ),
        AppGaps.vGap20,
        Row(
          mainAxisAlignment: MainAxisAlignment.spaceBetween,
          children: [
            _buildTextInDivider(
              '管控措施${ctrl.risk?.riskMeasuresCount ?? 0}条',
              Alignment.center,
            ),
            _buildTextInDivider(
              '应急预案${ctrl.risk?.emergencyPlanCount ?? 0}条',
              Alignment.center,
            ),
            _buildTextInDivider(
              '安全培训${ctrl.risk?.safetyTrainingCount ?? 0}条',
              Alignment.center,
            ),
          ],
        ),
        AppGaps.vGap10,
        SizedBox(
          height: 107.w,
          width: 107.w,
          child: SfCircularChart(
            series: <CircularSeries>[
              DoughnutSeries<ChartData, String>(
                dataSource: ctrl.leftRiskCounts,
                pointColorMapper: (ChartData data, _) => data.color,
                xValueMapper: (ChartData data, _) => data.x,
                yValueMapper: (ChartData data, _) => data.y,
                name: '剩余风险',
                dataLabelSettings: const DataLabelSettings(
                  isVisible: false,
                  labelPosition: ChartDataLabelPosition.inside,
                ),
                radius: '100%',
                innerRadius: '75%',
                enableTooltip: true,
              ),
            ],
            annotations: [
              CircularChartAnnotation(
                widget: ctrl.leftRiskCount == 0
                    ? Stack(
                        alignment: Alignment.center,
                        children: [
                          leftAnnoCenter,
                          SizedBox(
                            width: 73.w,
                            height: 73.w,
                            child: CircularProgressIndicator(
                              strokeWidth: 7.w,
                              value: 1,
                              valueColor: const AlwaysStoppedAnimation<Color>(Color(0xFFFC9900)),
                            ),
                          ),
                        ],
                      )
                    : leftAnnoCenter,
              ),
            ],
          ),
        ),
        CustomColorTypeIndicator(
          colors: ctrl.leftRiskCounts.map((e) => e.color ?? Colors.white).toList(),
          types: ctrl.leftRiskCounts.map((e) => e.x).toList(),
          vals: ctrl.leftRiskCounts.map((e) => e.y.toInt().toString()).toList(),
          matrix: (2, 2),
          padding: EdgeInsets.symmetric(horizontal: 11.w, vertical: 7.w),
        ),
        AppGaps.vGap10,
        _buildChartTitle('运行机制效果'),
        CustomGradientProgress(
          title: '风险分析完成率',
          vals: (
            actual: ctrl.actualRiskAnalysis,
            total: ctrl.riskAssess?.analysisCount ?? 0,
          ),
          indicators: CustomGradientProgress.centerTotalRightPercent,
        ).paddingSymmetric(vertical: 3.w),
        CustomGradientProgress(
          title: '排查任务完成率',
          vals: (
            actual: ctrl.actualInvestigation,
            total: ctrl.riskAssess?.investigationCount ?? 0,
          ),
          indicators: CustomGradientProgress.centerTotalRightPercent,
        ).paddingSymmetric(vertical: 3.w),
        CustomGradientProgress(
          title: '隐患整改完成率',
          vals: (
            actual: ctrl.actualRectification,
            total: ctrl.riskAssess?.rectificationCount ?? 0,
          ),
          indicators: CustomGradientProgress.centerTotalRightPercent,
        ).paddingSymmetric(vertical: 3.w),
      ]),
    );
  }

  Widget _buildUrgentMgmt() {
    final annoCenter = Container(
      width: 56.w,
      height: 56.w,
      decoration: BoxDecoration(
        color: Colors.white,
        borderRadius: BorderRadius.circular(50.w),
      ),
      child: Column(
        mainAxisAlignment: MainAxisAlignment.center,
        children: [
          Text(
            '总数',
            style: TextStyle(
              fontSize: 12.w,
              fontWeight: FontWeight.w400,
              color: const Color(0xffA0A7B5),
            ),
          ),
          Text(
            '${ctrl.urgentPlanCount}',
            style: TextStyle(fontSize: 16.w, fontWeight: FontWeight.w400, color: const Color(0xFF495061)),
          ),
        ],
      ),
    );
    return CustomCard(
      title: '应急管理情况',
      content: Column(
        children: [
          CustomCountPanel(counts: {
            '应急救援机构': ctrl.urgentCount?.emergencyRescueOrgNum?.toString() ?? '未知',
            '应急物资': ctrl.urgentCount?.sourcePointNum?.toString() ?? '未知',
            '演练计划': ctrl.urgentCount?.planNum?.toString() ?? '未知',
          }),
          AppGaps.vGap10,
          CustomCountPanel(counts: {
            '应急救援队伍': ctrl.urgentCount?.teamNum?.toString() ?? '未知',
            '应急专家': ctrl.urgentCount?.expertNum?.toString() ?? '未知',
            '演练部门': ctrl.urgentCount?.planCoverDeptNum?.toString() ?? '未知',
          }),
          AppGaps.vGap10,
          Row(
            mainAxisAlignment: MainAxisAlignment.spaceAround,
            children: [
              SizedBox(
                height: 107.w,
                width: 107.w,
                child: SfCircularChart(
                  series: <CircularSeries>[
                    DoughnutSeries<ChartData, String>(
                      dataSource: ctrl.urgentPlanCounts,
                      pointColorMapper: (ChartData data, _) => data.color,
                      xValueMapper: (ChartData data, _) => data.x,
                      yValueMapper: (ChartData data, _) => data.y,
                      name: '初始风险',
                      dataLabelSettings: const DataLabelSettings(
                        isVisible: false,
                        labelPosition: ChartDataLabelPosition.inside,
                      ),
                      radius: '100%',
                      innerRadius: '75%',
                      enableTooltip: true,
                    ),
                  ],
                  annotations: [
                    CircularChartAnnotation(
                      widget: ctrl.urgentPlanCount == 0
                          ? Stack(
                              alignment: Alignment.center,
                              children: [
                                annoCenter,
                                SizedBox(
                                  width: 73.w,
                                  height: 73.w,
                                  child: CircularProgressIndicator(
                                    strokeWidth: 7.w,
                                    value: 1,
                                    valueColor: const AlwaysStoppedAnimation<Color>(Color(0xFFFC9900)),
                                  ),
                                ),
                              ],
                            )
                          : annoCenter,
                    ),
                  ],
                ),
              ),
              CustomColorTypeIndicator(
                colors: ctrl.urgentPlanCounts.map((e) => e.color ?? Colors.white).toList(),
                types: ctrl.urgentPlanCounts.map((e) => e.x).toList(),
                matrix: (1, 4),
                padding: EdgeInsets.symmetric(horizontal: 5.w, vertical: 3.w),
              ),
            ],
          ),
        ],
      ),
    );
  }

  Widget _buildScenceMgmtItem(String title, String icon, void Function() onTap) {
    return Container(
      decoration: BoxDecoration(
        borderRadius: BorderRadius.circular(11.w),
        color: const Color(0x335C6DFF),
      ),
      width: 130.w,
      padding: EdgeInsets.symmetric(horizontal: 10.w, vertical: 10.w),
      child: Row(
        mainAxisAlignment: MainAxisAlignment.spaceBetween,
        children: [
          Column(
            crossAxisAlignment: CrossAxisAlignment.start,
            children: [
              Text(
                title,
                style: TextStyle(
                  fontWeight: FontWeight.w500,
                  fontSize: 12.w,
                  color: Colors.blue,
                ),
              ),
              SvgPicture.asset(AppImages.icon_arrow_right_special),
            ],
          ),
          SvgPicture.asset(icon, height: 27.w, width: 27.w),
        ],
      ),
    ).clickOnce(onTap);
  }

  Widget _buildInfoItem(String key, String val) {
    final isUrl = val.contains('/');
    if (isUrl) val = Interface.fileUrl + val;
    return Row(
      mainAxisAlignment: MainAxisAlignment.spaceBetween,
      children: [
        Text(
          '$key：',
          style: TextStyle(color: const Color(0xFFA5A6B5), fontSize: 13.w),
          textAlign: TextAlign.end,
        ),
        SizedBox(
          width: 170.w,
          child: Text(
            isUrl ? (val.split('/').lastOrNull ?? '未知') : val,
            maxLines: 2,
            textAlign: TextAlign.end,
            style: TextStyle(
              color: isUrl ? Colors.blue : const Color(0xFF495061),
              fontSize: 13.w,
            ),
          ).clickOnce(() {
            if (isUrl) FileUtils.openFile(val);
          }),
        )
      ],
    ).paddingSymmetric(vertical: 3.w);
  }

  Widget _buildChartTitle(String title) {
    return Row(
      children: [
        CustomCard.leadingSmall,
        AppGaps.hGap10,
        Text(
          title,
          style: TextStyle(fontSize: 14.w, color: const Color(0xFF5F57DC)),
        )
      ],
    ).paddingSymmetric(vertical: 7.w);
  }

  Widget _buildTextInDivider(String text, Alignment align) {
    return Align(
      alignment: align,
      child: Text(
        text,
        style: TextStyle(color: Colors.blue, fontSize: 12.w),
      ),
    );
  }
}
